//
//  MTOverlay.m
//
//  Copyright 2010 The MITRE Corporation. All rights reserved.
//

#import "MTOverlay.h"

@implementation MTOverlay

@synthesize dataSource;

- (id)initWithDataSource:(id <MTOverlayDataSource>)overlayDataSource
{
    if (self = [super init]) {
        dataSource = overlayDataSource;
    }
    return self;
}

- (CLLocationCoordinate2D)coordinate
{
    return MKCoordinateForMapPoint(MKMapPointMake(MKMapRectGetMidX(boundingMapRect), MKMapRectGetMidY(boundingMapRect)));
}

- (MKMapRect)boundingMapRect
{
    return dataSource.boundingMapRect;
}

- (void)dealloc {
	[dataSource release];
	
    [super dealloc];
}

@end
